package router

import (
	"database/sql"

	"gitee.com/hp-huiw/family-expense-api/internal/handler"
	"github.com/gin-gonic/gin"
)

// Sets routes for incomeExpenseDetail resource.
func SetIncomeExpenseDetailRoutes(routerGroup *gin.RouterGroup, db *sql.DB) {
	h := handler.NewIncomeExpenseDetailHandler(db)

	routerGroup.GET("/query-list-with-summary-by-account-group", h.QueryListWithSummaryByAccountGroup)
	routerGroup.GET("/query-list-by-account-group", h.QueryListByAccountGroup)
	routerGroup.GET("/query-total-amount-by-account-group", h.QueryTotalAmountByAccountGroup)
	routerGroup.GET("/query-details", h.QueryDetails)
	routerGroup.GET("/query-credit-card-bill", h.QueryCreditCardBill)
	routerGroup.GET("/query-credit-card-bill-amount", h.QueryCreditCardBillAmount)
	routerGroup.GET("/query-coordinates", h.QueryCoordinates)
	routerGroup.POST("/add", h.Add)
	routerGroup.POST("/update", h.Update)
	routerGroup.POST("/delete", h.Delete)
}
